FROM ubuntu:xenial

MAINTAINER atompi <atompi@foxmail.com>

# init
WORKDIR /usr/local/src
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN dpkg-reconfigure -f noninteractive tzdata
COPY sources.list /etc/apt/sources.list
RUN echo "nameserver 114.114.114.114" >> /etc/resolv.conf
RUN apt-get update

# install openjdk-8
RUN apt install openjdk-8-jdk -y

# install elasticsearch
RUN dpkg -i elasticsearch-2.4.4.deb

# config elasticsearch
RUN echo "network.host: $ELS_HOST" >> /etc/elasticsearch/elasticsearch.yml
RUN service elasticsearch start
CMD ["tail","-f","/var/log/elasticsearch/elasticsearch.log"]
EXPOSE 9200 9300
